<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('服务窗口评价列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>请选择窗口人员：</label>
                            <select  class="form-control" name="ckSessionId" th:with="type=${@dict.getType('sys_ck_user')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                                </option>
                            </select>
                        </li>
                        <li>
                            <label>满意度：</label>
                            <select class="form-control" name="pjDf">
                                <option value="">请选择满意度类型</option>
                                <option value="1">满意</option>
                                <option value="3">态度不好</option>
                                <option value="5">未解决问题</option>
                            </select>
                        </li>
                        <li>
                            <label>开始时间：</label>
                            <input type="text" class="form-control" name="startTime" id="startTime"
                                   placeholder="开始时间"/>
                        </li>
                        <li>
                            <label> 结束时间：</label>
                            <input type="text" class="form-control" name="endTime" id="endTime"
                                   placeholder="截止时间"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
<!--            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ckpj:add">-->
<!--                <i class="fa fa-plus"></i> 添加-->
<!--            </a>-->
<!--            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"-->
<!--               shiro:hasPermission="system:ckpj:edit">-->
<!--                <i class="fa fa-edit"></i> 修改-->
<!--            </a>-->
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:ckpj:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
<!--            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ckpj:export">-->
<!--                <i class="fa fa-download"></i> 导出-->
<!--            </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    layui.use('laydate', function () {

        function getMonthStart() {
            var now = new Date(); // 获取当前日期时间
            var monthStart = new Date(now.getFullYear(), now.getMonth(), 1); // 获取本月第一天的日期时间
            var monthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59); // 获取本月最后一天的日期时间（时间为23:59:59）
            return monthStart;
        }

        function getMonthEnd() {
            var now = new Date(); // 获取当前日期时间
            var monthStart = new Date(now.getFullYear(), now.getMonth(), 1); // 获取本月最后一天的日期时间
            var monthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59); // 获取本月最后一天的日期时间（时间为23:59:59）
            return monthEnd;
        }

        layui.laydate.render({
            elem: '#startTime',
            theme: 'molv',
            trigger: 'click',
            value: getMonthStart(),
            type: 'datetime'
        })

        layui.laydate.render({
            elem: '#endTime',
            theme: 'molv',
            value: getMonthEnd(),
            trigger: 'click',
            type: 'datetime'
        })
    });
</script>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ckpj:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ckpj:remove')}]];
    var prefix = ctx + "system/ckpj";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "服务窗口评价",
            columns: [{
                checkbox: true
            },
                {
                    field: 'ckPingjiaId',
                    title: '关键字',
                    visible: false
                },
                {
                    field: 'ckSessionId',
                    title: '窗口服务人员'
                },
                {
                    field: 'pjDf',
                    title: '评价类型',
                    formatter: function (value, row, index) {
                        if (value == '1') {
                            return '满意'
                        }
                        if (value == '3') {
                            return '一般'
                        }
                        if (value == '5') {
                            return '不满意'
                        }
                    }
                },
                {
                    field: 'pjContent',
                    title: '评价内容'


                },
                {
                    field: 'pjtime',
                    title: '评价时间'

                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>